package fun.flyee.android.pengshan.acts;


import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;

public class Result {

    @JSONField(name="resp_code")
    public int code;
    @JSONField(name="resp_msg")
    public String msg;
    @JSONField(name="datas")
    public Object data;

    public static Result genErr() {
        Result result = new Result();
        result.code = -1000;
        result.msg = "操作失败";
        return result;
    }

    public static Result genSuccess() {
        Result result = new Result();
        result.code = 200;
        result.msg = "操作成功";
        return result;
    }

    public static Result genErr(String msg) {
        Result result = new Result();
        result.code = -1000;
        result.msg = "timeout".equalsIgnoreCase(msg) ? "操作超时" : msg;
        return result;
    }

}
